/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.kungkhies.persistence.entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.validation.constraints.NotNull;

/**
 *
 * @author clayton
 */
@Embeddable 
public class PolyholePK implements Serializable 
{
    @Basic(optional = false)
    @NotNull
    @Column(name = "kungkhie_id")
    private long kungkhieId;
    @Basic(optional = false)
    @NotNull
    @Column(name = "polyhole_id")
    private long polyholeId;
    @Basic(optional = false)
    @NotNull
    @Column(name = "knode_id")
    private long knodeId;

    public PolyholePK()
    {
    }

    public PolyholePK(long kungkhieId, long polyholeId, long knodeId)
    {
        this.kungkhieId = kungkhieId;
        this.polyholeId = polyholeId;
        this.knodeId = knodeId;
    }

    public long getKungkhieId()
    {
        return kungkhieId;
    }

    public void setKungkhieId(long kungkhieId)
    {
        this.kungkhieId = kungkhieId;
    }

    public long getPolyholeId()
    {
        return polyholeId;
    }

    public void setPolyholeId(long polyholeId)
    {
        this.polyholeId = polyholeId;
    }

    public long getKnodeId()
    {
        return knodeId;
    }

    public void setKnodeId(long knodeId)
    {
        this.knodeId = knodeId;
    }

    @Override
    public int hashCode()
    {
        int hash = 0;
        hash += (int) kungkhieId;
        hash += (int) polyholeId;
        hash += (int) knodeId;
        return hash;
    }

    @Override
    public boolean equals(Object object)
    {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof PolyholePK))
        {
            return false;
        }
        PolyholePK other = (PolyholePK) object;
        if (this.kungkhieId != other.kungkhieId)
        {
            return false;
        }
        if (this.polyholeId != other.polyholeId)
        {
            return false;
        }
        if (this.knodeId != other.knodeId)
        {
            return false;
        }
        return true;
    }

    @Override
    public String toString()
    {
        return "com.kungkhies.persistence.entities.PolyholePK[ kungkhieId=" + kungkhieId + ", polyholeId=" + polyholeId + ", knodeId=" + knodeId + " ]";
    }

}
